package com.rose.springbootmoredatasourcemybatis;

import com.rose.springbootmoredatasourcemybatis.config.DynamicDataSourceRegister;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Import;
import org.springframework.transaction.annotation.EnableTransactionManagement;

@SpringBootApplication
@MapperScan("com.rose.springbootmoredatasourcemybatis.mapper") //扫描的mapper
@Import(DynamicDataSourceRegister.class)
@EnableTransactionManagement
public class SpringbootMoreDatasourceMybatisApplication {
//    @Bean
//    public DynamicDataSourceAnnotationAdvisor dynamicDatasourceAnnotationAdvisor() {
//        return new DynamicDataSourceAnnotationAdvisor(new DynamicDataSourceAnnotationInterceptor());
//    }
    public static void main(String[] args) {
        SpringApplication.run(SpringbootMoreDatasourceMybatisApplication.class, args);
    }
}
